FROM php:7.4-cli

# docker build -t swoole:4.8.2-7.4-cli -f swoole.Dockerfile .

LABEL image.authors="jani <liberty_linlin@qq.com>"

WORKDIR /app

RUN apt update && apt install -y libzip-dev  && docker-php-ext-install zip mysqli pdo_mysql bcmath iconv

# redis
RUN curl -o redis-5.3.7.tgz http://pecl.php.net/get/redis-5.3.7.tgz \
    && pecl install redis-5.3.7.tgz \
    && docker-php-ext-enable redis \
    && rm -rf redis-5.3.7.tgz

# swoole
RUN curl -o swoole-4.8.12.tgz http://pecl.php.net/get/swoole-4.8.12.tgz \
    && pecl install swoole-4.8.12.tgz \
    && docker-php-ext-enable swoole \
    && rm -rf swoole-4.8.12.tgz

# 添加 composer 工具
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN chmod +x /usr/bin/composer \
    && /usr/bin/composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
